﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPageAfterLogin.master" AutoEventWireup="true" CodeFile="Contacts.aspx.cs" Inherits="Contacts" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table cellspacing="20">
<tr>
    <td valign="top">
    <h1>Add Single Contact</h1>
    <asp:HiddenField ID="hfLoginID" runat="server" />
   
<table>
    <tr>
        <td>
            Group Name
        </td>
        <td>
            :
        </td>
        <td>
            <asp:DropDownList ID="ddlGroups" runat="server">
            </asp:DropDownList>
        </td>        
    </tr>
    <tr>
        <td>
            Contact Name
        </td>
        <td>
            :
        </td>
        <td>
            <asp:TextBox ID="txtContactName" runat="server"></asp:TextBox>
        </td>        
    </tr>
    <tr>
        <td>
            Short Name
        </td>
        <td>
            :
        </td>
        <td>
            <asp:TextBox ID="txtShortName" runat="server"></asp:TextBox>
        </td>        
    </tr>
    <tr>
        <td>
            Mobile
        </td>
        <td>
            :
        </td>
        <td>
            <asp:TextBox ID="txtMobile" runat="server"></asp:TextBox>
        </td>        
    </tr>
    <tr>
        <td>
            
        </td>
        <td>
            
        </td>
        <td>
            <asp:Button ID="btnSaveContact" runat="server" Text="Save" 
                onclick="btnSaveContact_Click" />
        </td>        
    </tr>    
</table>
    </td>
    <td valign="top">
    <h1>Add Contacts from file</h1>
<table>
    <tr>
        <td>
            Group Name
        </td>
        <td>
            :
        </td>
        <td>
            <asp:DropDownList ID="ddlFileContactGroup" runat="server">
            </asp:DropDownList>
        </td>        
    </tr>
    
    <tr>
        <td>
            File
        </td>
        <td>
            :
        </td>
        <td>
            <asp:FileUpload ID="fuldStock" runat="server" />
        </td>        
    </tr>
    <tr>
        <td>
            
        </td>
        <td>
            
        </td>
        <td>
            <a target="_blank" href="tmp/SampleMobileNoFile.txt">Click here to download sample file</a>
        </td>        
    </tr>
    <tr>
        <td>
            
        </td>
        <td>
            
        </td>
        <td>
            <asp:Button ID="btnFileUpload" runat="server" Text="Upload File" 
                onclick="btnFileUpload_Click"  />
        </td>        
    </tr>    
</table>
    </td>
</tr>
</table>


<h1>Contact List</h1>
<table>
<tr>
        <td>
            Group
        </td>
        <td>
            :
        </td>
        <td>
            <asp:DropDownList ID="ddlGroupShow" runat="server">
            </asp:DropDownList>
            <asp:Button ID="btnShow" runat="server" Text="Show" onclick="btnShow_Click" />
        </td>        
    </tr>
    
</table>
<asp:GridView ID="gvContact" runat="server" AutoGenerateColumns="false" CssClass="gridCss" Width="100%">
            <Columns>
                <asp:TemplateField HeaderText="Name">
                    <ItemTemplate>
                        <asp:Label ID="lblHeadTypeName" runat="server" Text='<%#Eval("Name") %>'>
                        </asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Short Name">
                    <ItemTemplate>
                        <asp:Label ID="lblExtraField1" runat="server" Text='<%#Eval("ShortName") %>'>
                        </asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Mobile">
                    <ItemTemplate>
                        <asp:Label ID="Mobile" runat="server" Text='<%#Eval("MobileNo") %>'>
                        </asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Delete">
                    <ItemTemplate>
                        <asp:LinkButton ID="lbDelete" runat="server" OnClientClick="return confirm('Are You Sure To Delete?')"  CommandArgument='<%#Eval("ContactID") %>' OnClick="lbDeleteContact_Click">
                            Delete
                        </asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
</asp:Content>

